package org.example.springboot.controller;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 莫磊
 * @date 2025/8/15
 * @description
 */
@Data
@RestController
public class HelloController {

    @Value("${custom.default-file-config}")
    private String defaultFileConfig;

    @Value("${custom.default-file-current}")
    private String defaultFileCurrent;

    @Value("${custom.default-classpath-config}")
    private String defaultClasspathConfig;

    @Value("${custom.default-classpath-current}")
    private String defaultClasspathCurrent;

    @Value("${custom.rule}")
    private String rule;

    @Value("${jdbc.url}")
    private String jdbcUrl;


    @GetMapping("/")
    public String index() {
        return "hello this's springBoot3 first!";
    }

    @GetMapping("/config")
    public String config() {
        return "default-file-config: " + defaultFileConfig + "<br/>" +
                "default-file-current: " + defaultFileCurrent + "<br/>" +
                "default-classpath-config: " + defaultClasspathConfig + "<br/>" +
                "default-classpath-current: " + defaultClasspathCurrent + "<br/>" +
                "rule: " + rule + "<br/>" +
                "jdbc: " + jdbcUrl;
    }
}
